// https://leetcode.cn/problems/maximum-number-of-words-you-can-type/description/

import "strings"
func canBeTypedWords(text string, brokenLetters string) int {
    l, r := 0, 0
	ans := 0
	for r < len(text) {
		for text[r] != " " {
			r++
		}
		t := text[l:r]
		f := true
		for _, v := range brokenLetters {
			if strings.Contains(t, v) {
				f = false
				break
			}
		}
		if f {
			ans += 1
		}
		r++
		l = r
	}
	return ans
}